home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ColorPicker.h
-
- Copyright: © 1984-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Version: Universal Interfaces 2.0a1. ETO #15, MPW prerelease. Sunday, July 17, 1994.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
-
- #ifndef __COLORPICKER__
- #define __COLORPICKER__
-
-
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
- /* #include <Types.h> */
- /* #include <ConditionalMacros.h> */
- /* #include <MixedMode.h> */
- /* #include <QuickdrawText.h> */
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if GENERATINGPOWERPC
- #pragma options align=mac68k
- #endif
-
- #ifdef __CFM68K__
- #pragma lib_export on
- #endif
-
-
- enum {
- /*Maximum small fract value, as long*/
- MaxSmallFract = 0x0000FFFF
- };
-
- /* A SmallFract value is just the fractional part of a Fixed number,
- which is the low order word. SmallFracts are used to save room,
- and to be compatible with Quickdraw's RGBColor. They can be
- assigned directly to and from INTEGERs. */
- /* Unsigned fraction between 0 and 1 */
- typedef unsigned short SmallFract;
-
- /* For developmental simplicity in switching between the HLS and HSV
- models, HLS is reordered into HSL. Thus both models start with
- hue and saturation values; value/lightness/brightness is last. */
- struct HSVColor {
- SmallFract hue; /*Fraction of circle, red at 0*/
- SmallFract saturation; /*0-1, 0 for gray, 1 for pure color*/
- SmallFract value; /*0-1, 0 for black, 1 for max intensity*/
- };
- typedef struct HSVColor HSVColor;
-
- struct HSLColor {
- SmallFract hue; /*Fraction of circle, red at 0*/
- SmallFract saturation; /*0-1, 0 for gray, 1 for pure color*/
- SmallFract lightness; /*0-1, 0 for black, 1 for white*/
- };
- typedef struct HSLColor HSLColor;
-
- struct CMYColor {
- SmallFract cyan;
- SmallFract magenta;
- SmallFract yellow;
- };
- typedef struct CMYColor CMYColor;
-
- extern pascal SmallFract Fix2SmallFract(Fixed f)
- THREEWORDINLINE(0x3F3C, 0x0001, 0xA82E);
- extern pascal Fixed SmallFract2Fix(SmallFract s)
- THREEWORDINLINE(0x3F3C, 0x0002, 0xA82E);
- extern pascal void CMY2RGB(const CMYColor *cColor, RGBColor *rColor)
- THREEWORDINLINE(0x3F3C, 0x0003, 0xA82E);
- extern pascal void RGB2CMY(const RGBColor *rColor, CMYColor *cColor)
- THREEWORDINLINE(0x3F3C, 0x0004, 0xA82E);
- extern pascal void HSL2RGB(const HSLColor *hColor, RGBColor *rColor)
- THREEWORDINLINE(0x3F3C, 0x0005, 0xA82E);
- extern pascal void RGB2HSL(const RGBColor *rColor, HSLColor *hColor)
- THREEWORDINLINE(0x3F3C, 0x0006, 0xA82E);
- extern pascal void HSV2RGB(const HSVColor *hColor, RGBColor *rColor)
- THREEWORDINLINE(0x3F3C, 0x0007, 0xA82E);
- extern pascal void RGB2HSV(const RGBColor *rColor, HSVColor *hColor)
- THREEWORDINLINE(0x3F3C, 0x0008, 0xA82E);
- extern pascal Boolean GetColor(Point where, ConstStr255Param prompt, const RGBColor *inColor, RGBColor *outColor)
- THREEWORDINLINE(0x3F3C, 0x0009, 0xA82E);
-
- #ifdef __CFM68K__
- #pragma lib_export off
- #endif
-
- #if GENERATINGPOWERPC
- #pragma options align=reset
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __COLORPICKER__ */
-